#include <stdio.h>
#include <stdlib.h>

typedef char E;

typedef struct TreeNode0 {
    E element;
    struct TreeNode0 *left;
    struct TreeNode0 *right;
} *TreeNode0;

void preOrder(TreeNode0 root) {   //传入的是二叉树的根结点
    if (root == NULL) return;
    printf("%c", root->element);
    preOrder(root->left);
    preOrder(root->right);
}

int main() {
    TreeNode0 a = (TreeNode0) malloc(sizeof(struct TreeNode0));
    TreeNode0 b = (TreeNode0) malloc(sizeof(struct TreeNode0));
    TreeNode0 c = (TreeNode0) malloc(sizeof(struct TreeNode0));
    TreeNode0 d = (TreeNode0) malloc(sizeof(struct TreeNode0));
    TreeNode0 e = (TreeNode0) malloc(sizeof(struct TreeNode0));
    TreeNode0 f = (TreeNode0) malloc(sizeof(struct TreeNode0));
    a->element = 'A';
    b->element = 'B';
    c->element = 'C';
    d->element = 'D';
    e->element = 'E';
    f->element = 'F';

    a->left = b;
    a->right = c;
    b->left = d;
    b->right = e;
    c->right = f;
    c->left = NULL;
    d->left = e->right = NULL;
    e->left = e->right = NULL;
    f->left = f->right = NULL;

    preOrder(a);
}